package com.schoolegard.services.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.schoolegard.services.JobsService;
import com.schoolgard.dao.JobModeDao;
import com.schoolgard.dao.JobStatusDao;
import com.schoolgard.dao.JobsDao;
import com.schoolgard.entitybean.JobMode;
import com.schoolgard.entitybean.JobStatus;
import com.schoolgard.entitybean.Jobs;

public class JobsServiceImpl implements JobsService {
	private static Logger logger = Logger.getLogger(JobsServiceImpl.class);
	
	private JobsDao jobsDao;
	private JobModeDao jobModeDao;
	private JobStatusDao jobStatusDao;
	public void setJobsDao(JobsDao jobsDao) {
		this.jobsDao = jobsDao;
	}
	public void setJobModeDao(JobModeDao jobModeDao) {
		this.jobModeDao = jobModeDao;
	}
	public void setJobStatusDao(JobStatusDao jobStatusDao) {
		this.jobStatusDao = jobStatusDao;
	}

	@Override
	public List<Jobs> findAll() {
		return jobsDao.findAll();
	}
	@Override
	public List<JobStatus> findJobStatus() {
		return jobStatusDao.findAll();
	}
	@Override
	public List<JobMode> findJobMode() {
		return jobModeDao.findAll();
	}
	@Override
	public JobMode findJobModeById(Long modeId) {
		return jobModeDao.findById(modeId);
	}
	@Override
	public JobStatus findjobStatusById(Long statusId) {
		return jobStatusDao.findById(statusId);
	}
	@Override
	public void saveOrUpdate(Jobs job) {
		jobsDao.createOrModify(job);
	}
	@Override
	public void delete(Long id) {
		jobsDao.remove(findById(id));
	}
	@Override
	public Jobs findById(Long id) {
		return jobsDao.findById(id);
	}
	

}
